import { put, takeEvery } from 'redux-saga/effects'
import { GET_MY_LIST } from './actionTypes'
import { getListAction } from './actionCreators'
import axios from 'axios'

function* mySaga() {
  yield takeEvery(GET_MY_LIST, getList)
}

function* getList() {
  const res = yield axios.get('https://www.easy-mock.com/mock/5f8fd789bcca63581f44c444/redux/getList')
  const action = getListAction(res.data.data.list)
  yield put(action)
}
export default mySaga
